package yhao.infra.feature.qiniu.oss.core;

import yhao.infra.feature.qiniu.oss.QiniuOssProperties;
import yhao.infra.feature.qiniu.oss.core.response.QiniuBaseResponse;

/**
 * @author yoara
 * <p> Created on 2019/9/25 </p>
 */
public abstract class QiniuBaseRequest<T extends QiniuBaseResponse> {
    protected BucketInfo protectBucket;
    protected BucketInfo fileBucket;
    protected QiniuOssProperties qiniuProperties;

    public T doRequest(QiniuOssComponent qiniuOssComponent){
        protectBucket = qiniuOssComponent.getProtectBucket();
        fileBucket = qiniuOssComponent.getFileBucket();
        qiniuProperties = qiniuOssComponent.getQiniuProperties();
        return doRequest();
    }

    protected abstract T doRequest();
}
